
class CodeBookMixin:
    @classmethod
    def _to_list(cls):
        out = []
        for key, value in cls.__dict__.items():
            if key[0] != '_':
                out.append(value)
        return out


class CBA(CodeBookMixin):
    tax_type = 'TIPO_LOTE'
    tax_type_predial = 'O'
    tax_type_arbitrios = 'R'
    date_valor_emitted = 'FECHA_EMISION'
    date_notify_valor = 'FECHA_NOTIFIC'
    date_rec1_emitted = 'EXPC_CHFECREC'
    date_call_made = 'call_date'
    number_of_calls = 'cumul_calls'
    tax_payer_id = 'CODIGO'
    executor1 = 'EJECUTOR'
    executor2 = 'AUXILIAR'
    discount = 'DESCUENTO'
    paid = 'PAGADO'
    pending = 'PENDIENTE'
    date_rec1_notified = 'FECHA_NOTIF_RES1'
    date_possible_medida = 'FECHA_NOTIF_ULT_ACTUADO'
    assignment_to_treatment = 'GRUPO'
    treatment = 'PROYECTO'
    control = 'CONTROL'
    medida_confirmed = 'ACT_EXP_PRINC'
    which_taxes = 'COMPRENDE_VALOR'


class CBC:
    taxpayer_id = 'codigo'
    treatment_assignment = 'treatment_lab'
    assignment_control = 'C'
    assignment_treatment = 'P'
    answered_true = 'ANSWERED'
    answered_false = 'NO ANSWER'
    assigned_collector = 'gestor_asignado'
    call_date = 'hora_sistema'
    call_duration = 'duracion_sistema'
    call_answered = 'estado_llamada'
    paid = 'pago_20210812'
    partial_payment = 'pago_parcial_20210812'


class VP:
    @staticmethod
    def fech_name(string_num, tax_type):
        var_name = 'FECHA_' + tax_type + '_BASE_' + string_num
        return var_name
    @staticmethod
    def pago_name(string_num, tax_type):
        var_name = tax_type + '21_' + string_num + "_BASE"
        return var_name
    rename_dict = {'codigo': 'CODIGO'}
    for i in range(1,13):
        if i<10:
            string_num = '0' + str(i)
        else:
            string_num = str(i)
        key_fecha = 'fecha_arb_' + string_num
        key_pago = 'pago_arb_' + string_num + '_v'
        rename_dict[key_fecha] = fech_name.__func__(string_num, 'AR')
        rename_dict[key_pago] = pago_name.__func__(string_num, 'ARB')
    for i in range(1,5):
        string_num = '0' + str(i)
        key_fecha = 'fecha_ip_' + string_num
        key_pago = 'pago_ip_' + string_num + '_v'
        rename_dict[key_fecha] = fech_name.__func__(string_num, 'IP')
        rename_dict[key_pago] = pago_name.__func__(string_num, 'IP')
